package com.shop.loan.model.vo;

import lombok.Getter;
import lombok.Setter;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.Readonly;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.ChoiceType;
import xyz.erupt.annotation.sub_field.sub_edit.InputType;
import xyz.erupt.annotation.sub_field.sub_edit.VL;
import xyz.erupt.jpa.model.BaseModel;

import javax.persistence.Transient;
import java.math.BigDecimal;

@Erupt(name = "设置优惠金额")
@Getter
@Setter
public class DiscountsVo extends BaseModel {


    @Transient
    @EruptField(
            edit = @Edit(title = "账单信息", type = EditType.DIVIDE)
    )
    private String divide_base;

    private Long orderId;

    @Transient
    @EruptField(
            views = @View(title = "总金额"),
            edit = @Edit(title = "总金额", readonly = @Readonly)
    )
    private BigDecimal totalMoney;

    @Transient
    @EruptField(
            views = @View(title = "已还金额"),
            edit = @Edit(title = "已还金额", readonly = @Readonly)
    )
    private BigDecimal payMoney;

    @Transient
    @EruptField(
            views = @View(title = "商品金额"),
            edit = @Edit(title = "商品金额", readonly = @Readonly)
    )
    private BigDecimal shopMoney;

    @Transient
    @EruptField(
            views = @View(title = "已还商品金额"),
            edit = @Edit(title = "已还商品金额", readonly = @Readonly)
    )
    private BigDecimal payMoneyByGoods;

    @Transient
    @EruptField(
            views = @View(title = "总期数"),
            edit = @Edit(title = "总期数", readonly = @Readonly)
    )
    private Integer totalPeriod;

    //期数
    @Transient
    @EruptField(
            views = @View(title = "当前期数"),
            edit = @Edit(title = "当前期数", readonly = @Readonly)
    )
    private Integer period;

    //本期金额
    @Transient
    @EruptField(
            views = @View(title = "本期金额"),
            edit = @Edit(title = "本期金额", readonly = @Readonly)
    )
    private BigDecimal periodMoney;

    //本期利息
    @Transient
    @EruptField(
            views = @View(title = "本期利息"),
            edit = @Edit(title = "本期利息", readonly = @Readonly)
    )
    private BigDecimal periodRateMoney;

    //已还金额
    @Transient
    @EruptField(
            views = @View(title = "本期已还本息"),
            edit = @Edit(title = "本期已还本息", readonly = @Readonly)
    )
    private BigDecimal periodPayMoney;


    //已优惠金额
    @Transient
    @EruptField(
            views = @View(title = "本期优惠本息"),
            edit = @Edit(title = "本期优惠本息", readonly = @Readonly)
    )
    private BigDecimal periodDiscountMoney;

    @Transient
    @EruptField(
            edit = @Edit(title = "本期待还", type = EditType.DIVIDE)
    )
    private String divide_un_pay;


    @Transient
    @EruptField(
            views = @View(title = "待还本息"),
            edit = @Edit(title = "待还本息", readonly = @Readonly)
    )
    private BigDecimal periodUnMoney;


    @Transient
    @EruptField(
            edit = @Edit(title = "优惠信息", type = EditType.DIVIDE)
    )
    private String divide_pay;

    @Transient
    @EruptField(
            views = @View(title = "优惠金额"),
            edit = @Edit(title = "优惠金额", notNull = true, placeHolder = "会替换之前优惠金额")
    )
    private BigDecimal number;


    @Transient
    @EruptField(
            views = @View(title = "优惠类型"),
            edit = @Edit(
                    title = "优惠类型",
                    type = EditType.CHOICE,
                    notNull = true,
                    choiceType = @ChoiceType(
                            vl = {
                                    @VL(label = "本息", value = "1"),
                                    @VL(label = "商品金额", value = "2"),
                            }
                    ))
    )
    private Integer payType;


    @Transient
    @EruptField(
            views = @View(title = "还款密码"),
            edit = @Edit(
                    title = "还款密码",
                    notNull = true,
                    inputType = @InputType(type = "password")
            )
    )
    private String password;

}
